package org.learn.test;

public class OverLoad01 {
    public static void main(String[] args) {
        Load mc = new Load();
        System.out.println(mc.MyCalculate(1,2.3));
    }
}
class Load{
    //方法重载必须形参顺序，数量，类型至少一个不一样。
    public int MyCalculate(int n1,int n2){
        int n3 = 0;
        n3 = n1 + n2;
        return n3;
    }
    public double MyCalculate(int n1,double n2){
        double n3 = 0;
        n3 = n1 + n2;
        return n3;
    }
    public double MyCalculate(double n1,int n2){
        double n3 = 0;
        n3 = n1 + n2;
        return n3;
    }
    public double MyCalculate(int n1,int n2,int n3){
        int n4 = 0;
        n4 = n1 + n2 + n3;
        return n4;
    }
}
